package com.yjs.houtai.controller;

import com.yjs.houtai.entity.Indent;
import com.yjs.houtai.entity.Message;
import com.yjs.houtai.service.IndentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@ResponseBody
@Api(tags = "订单信息")
@RestController
@RequestMapping("/api/table")
public class IndentController {
    @Resource
    private IndentService indentService;

    @ApiOperation(value="增添订单")
    @PostMapping("/add")
    public Message insertSelective(Indent indent){
        return indentService.insertSelective(indent);
    }

    @ApiOperation(value="删除订单")
    @DeleteMapping("/delete")
    public Message deleteByPrimaryKey(int indentId){
        return indentService.deleteByPrimaryKey(indentId);
    }

    @ApiOperation(value="修改订单")
    @PutMapping("/update")
    public Message updateByPrimaryKeySelective(Indent indent)
    {
        return indentService.updateByPrimaryKeySelective(indent);
    }

    @ApiOperation(value="查找订单")
    @GetMapping("/select")
    public Message selectByPrimaryKey (int indentId){
        return  indentService.selectByPrimaryKey(indentId);
    }

    @ApiOperation(value="查找所有订单")
    @GetMapping("/selectAll")
    public Message selectAll(){
        return  indentService.selectAll();
    }

}
